Demonic Testing of Concurrent Programs
نویسندگان
چکیده
Testing presents a daunting challenge for concurrent programs, as non-deterministic scheduling defeats reproducibility. The problem is even harder if, rather than testing entire systems, one tries to test individual components, for example to assess them for thread-safety. We present demonic testing, a technique combining the tangible results of unit testing with the rigour of formal rely-guarantee reasoning to provide deterministic unit testing for concurrent programs. Deterministic execution is provided by abstracting threads away via rely-guarantee reasoning, and replacing them with “demonic” sequences of interfering instructions that drive the program to break invariants. Demonic testing reuses existing unit tests to drive the routine under test, using the execution to discover demonic interference. Programs carry contract-based rely-guarantee style specifications to express what sort of thread interference should be tolerated. Aiding the demonic testing technique is an interference synthesis tool we have implemented based on SMT solving. The technique is shown to find errors in contracted versions of several benchmark applications.
منابع مشابه
A Calculus for Predicative Programming
A calculus for developing programs from specifications written as predicates that describe the relationship between the initial and final state is proposed. Such specifications are well known from the specification language Z. All elements of a simple sequential programming notation are defined in terms of predicates. Hence programs form a subset of specifications. In particular, sequential com...
متن کاملDemonic Fixed Points
We deal with a relational model for the demonic semantics of programs. The demonic semantics of a while loop is given as a fixed point of a function involving the demonic operators. This motivates us to investigate the fixed points of these functions. We give the expression of the greatest fixed point with respect to the demonic ordering (demonic inclusion) of the semantic function. We prove th...
متن کاملRestricted demonic choice for modular probabilistic programs
It is argued that one approach to modularity in programs containing both demonic and probabilistic choice is to allow variations on the former: `restricted demonic choice', written u L , is not allowed to use the value of variables named in the set L as it resolves its nondeterminism; ordinary demonic choice u is then just the special case u fg in which the set of hidden variables is empty. The...
متن کاملCorrectness and Refinement of Dually Nondeterministic Programs
In this paper we extend different reasoning methods from traditional (demonic) programs to programs with both demonic and angelic nondeterminism. In particular, we discuss correctness proofs, and refinement of programs while reducing angelic nondeterminism (into demonic nondeterminism or determinism). As expected, reducing angelic nondeterminism is generally not a refinement; however, when cont...
متن کاملPartial correctness for probabilistic demonic programs
Recent work in sequential program semantics has produced both an operational (He et al., Sci. Comput. Programming 28(2, 3) (1997) 171–192) and an axiomatic (Morgan et al., ACM Trans. Programming Languages Systems 18(3) (1996) 325–353; Seidel et al., Tech Report PRG-TR-6-96, Programming Research group, February 1996) treatment of total correctness for probabilistic demonic programs, extending Ko...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2012